#!/bin/bash -e

function info() {
    echo Usage: `basename $0` [-p out_prefix -s out_suffix] sh_name_prefix
    exit 1
}

while getopts ":p:s:t:" opt; do
    case $opt in
        p) out_prefix=$OPTARG;;
        s) out_suffix=$OPTARG;;
        t) threads=$OPTARG;;
        ?) info;;
    esac
done
shift $(($OPTIND - 1))

if [ $# -lt 1 ]; then info; fi

. $var

cat <<temp > $1.sh && chmod 755 $1.sh
#!/bin/bash -e

function info() {
    echo Usage: \`basename \$0\` [-p out_prefix -s out_suffix] args
    exit 1
}

while getopts ":p:s:t:" opt; do
    case \$opt in
        p) out_prefix=\$OPTARG;;
        s) out_suffix=\$OPTARG;;
        t) threads=\$OPTARG;;
        ?) info;;
    esac
done
shift \$((\$OPTIND - 1))

if [ \$# -lt 1 ]; then info; fi

. \$var || :

. \$cmd_done

temp

. $cmd_done
